]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Bail out when not on a monitor
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Aug 2021 01:21:47 +0000 (03:21 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Aug 2021 13:16:54 +0000 (15:16 +0200)
There shouldn't be any code that calls zoomOutActor() without
a monitor, but throwing in an early return doesn't hurt.

CID 351285.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>

js/ui/iconGrid.js

index efc638913e431a4951e19484e3cba0a4a05f00b4..65b130ce745f0edaed2143e6169b9e80a8d6b8c9 100644 (file)
@@ -193,6 +193,10 @@ function zoomOutActor(actor) {
 }
 
 function zoomOutActorAtPos(actor, x, y) {
+    const monitor = Main.layoutManager.findMonitorForActor(actor);
+    if (!monitor)
+        return;
+
     const actorClone = new Clutter.Clone({
         source: actor,
         reactive: false,
@@ -207,7 +211,6 @@ function zoomOutActorAtPos(actor, x, y) {
     Main.uiGroup.add_actor(actorClone);
 
     // Avoid monitor edges to not zoom outside the current monitor
-    let monitor = Main.layoutManager.findMonitorForActor(actor);
     let scaledWidth = width * APPICON_ANIMATION_OUT_SCALE;
     let scaledHeight = height * APPICON_ANIMATION_OUT_SCALE;
     let scaledX = x - (scaledWidth - width) / 2;